from django.db import models
from utils.base_model import BaseModel


class EnvironmentModel(BaseModel):

    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=50, verbose_name="该名称", help_text="环境名称", unique=True)
    url = models.CharField(max_length=100, verbose_name="环境地址", help_text="环境地址", unique=True)
    description = models.TextField(max_length=200, verbose_name="环境描述", help_text="环境描述", blank=True, null=True)
    is_delete = models.IntegerField(verbose_name="逻辑删除(0-未删除、1-删除)", help_text="逻辑删除(0-未删除、1-删除)",
                                    default=0)

    class Meta:
        db_table = "dtp_environment"
        verbose_name = "环境"
        verbose_name_plural = verbose_name

    def __str__(self):
        return self.name
